-- attack_curse
-- created by zhuangsl
-- 攻击附带诅咒

return {
    apply = function(prop, baseValue)
        return baseValue;
    end,

    -- 攻击触发
    trigger = function(who, prop, arg)
        local target = arg;
        -- 概率触发

        local rand = DungeonM.getRandSeed("attack_curse") % 1000;
        if (rand > prop[3]) then
            return;
        end

        local propId = PropM.getPropId("curse");
        local v = prop[2];

        -- 减益状态
        local effectRound = CombatM.getRound() + prop[4];
        local arr = ({ propId, 1, v, effectRound, });

        local condition = {
            ["prop"] = arr,
            ["end_round"] = effectRound,
        };

        -- 附加状态
        CombatStatusM.applyStatus(target, "curse", condition);
        
        return arr;
    end,

    record = function(target, prop, path)
        return false;
    end 
};